<template>
  <div>
    <div class="main_title">
      <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
      <slot></slot>
      <div>
      </div>
    </div>
    <div class="main_title" v-if="title">
      <div class="title">{{title}}</div>
      <div>
        <el-button v-for="(item,index) in buttonparameters" :key="index" :type="item.type?item.type:''" size="medium" @click="Publicevents(item.cname)">{{ item.title }}</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import Breadcrumb from '@/components/Breadcrumb'
export default {
  name: 'PageTitle',
  components: {
    Breadcrumb
  },
  props: {
    buttonparameters: {
      type: Array,
      default() {
        return []
      }
    },
    title:{
      type: String,
      default() {
        return '';
      }
    }
  },
  watch: {
    buttonparameters: {
      handler: function(val) {
        this.buttonparameters = val
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    Publicevents(val) {
      this.$emit('Publicevents', val)
    }
  }
}
</script>
<style scoped lang="scss">
.main_title{
    font-size: 16px;
    color: #00194A;
    height: 58px;
    display: flex;
    padding-left: 22px;
    background: #ffffff;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
    padding-right: 50px;
    margin-bottom:12px;
  border-radius: 0 0 5px 5px;
  .title{
    font-size: 16px;
    font-weight: bold !important;
    color: #195ABE;
    position: relative;
    padding-left: 8.5px;
    &::before{
      content: '';
      width: 3px;
      height: 15px;
      background-color: #195ABE;
      position: absolute;
      left: 0;
      top: 0;
    }
  }
  ::v-deep.app-breadcrumb.el-breadcrumb{
    margin-left: 0;
  }
  ::v-deep.el-breadcrumb__item{
    .el-breadcrumb__inner{
      a,span{
        font-size: 16px;
        font-weight: bold !important;
        color: #00194A;
      }
    }
    .el-breadcrumb__separator{
      font-size: 16px;
      font-weight: bold;
      color: #00194A;
      margin: 0 5px;
    }
  }
}
</style>
